package com.cosina.game.crystallight.ui.menu;

import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.view.View;

import com.cosina.game.crystallight.CrystalLightActivity;
import com.cosina.game.crystallight.ui.ResourceManager;
import com.cosina.game.crystallight.ui.ResourceReference;

public class LoadingView extends View{

	private CrystalLightActivity activity;
	public LoadingView(CrystalLightActivity activity) {
		super(activity);
		this.activity = activity;
		this.setBackgroundDrawable(new BitmapDrawable(ResourceManager.getNoCahce(ResourceReference.IMG_LOADIND_MAIN)));
	}

	private final Runnable runable = new Runnable(){
		@Override
		public void run(){
			activity.doShowMenu();
		}
	};
	
	@Override
	protected void onDraw(Canvas canvas) {
		this.postDelayed(runable, 2000);
	}
}
